---
title: Go
sidebar_position: 1
---

# Go

Source code: [github.com/oras-project/oras-go](https://github.com/oras-project/oras-go)

## Introduction

The ORAS Go client library provides the ability to replicate artifacts between different [Targets](./overview.mdx#target).  
Furthermore, the version `v2` is a registry client conforming [image-spec v1.1.0-rc6](https://github.com/opencontainers/image-spec/releases/tag/v1.1.0-rc6) and [distribution-spec v1.1.0-rc4](https://github.com/opencontainers/distribution-spec/releases/tag/v1.1.0-rc4).

Using the ORAS Go client library, you can develop your own registry client:

```sh
myclient push artifacts.example.com/myartifact:1.0 ./mything.thang
```

## Usage

The package `oras.land/oras-go/v2` can quickly be imported in other Go-based tools that
wish to benefit from the ability to store arbitrary content in container registries.

1. Get the  `oras.land/oras-go/v2` package
```sh
go get oras.land/oras-go/v2
```

2. Import and use the `v2` package
```go
import "oras.land/oras-go/v2"
```

3. Run
```sh
go mod tidy
```

**The API documentation and examples are available at [pkg.go.dev](https://pkg.go.dev/oras.land/oras-go/v2).**

## Quick Start

### Push files to a remote repository
See [this example](https://pkg.go.dev/oras.land/oras-go/v2#example-package-PushFilesToRemoteRepository).

### Pull files from a remote repository
See [this example](https://pkg.go.dev/oras.land/oras-go/v2#example-package-PullFilesFromRemoteRepository).

### Pull a docker or OCI image from a remote repository
See [this example](https://pkg.go.dev/oras.land/oras-go/v2#example-package-PullImageFromRemoteRepository).

### Pull an Image using the Docker credential store
See [this example](https://pkg.go.dev/oras.land/oras-go/v2#example-package-PullImageUsingDockerCredentials).
